import os,sys
sys.path.append(os.getcwd())
sys.path.append(os.path.join(os.getcwd(),'system\library'))
sys.path.append(os.path.join(os.getcwd(),'system'))

import library
import model

class testdb():
    def __init__(self, parent=None):
        pass
    
    def index(self):   #with model first
        #self.db = library.db()
        data = model.m_user()
        #self.conn = self.db.makeConn()
        print data.getdata(1)
        #self.data = self.db.select(self.conn,'tpengguna')
        #print self.data
        
    def index2(self):  #direct to library
        db = library.db()
        db.fieldname = ['id','name']
        db.where = ['name','raja']
        conn = db.makeConn()
        data = db.selectbyfield(conn, 'tpengguna')
        print data
        
if __name__ == '__main__':
    myapp = testdb()
    myapp.index2()
        
        